<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>客户记录</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/font.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/xadmin.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/xadmin.js"></script>
    <script charset="utf-8" language="javascript" type="text/javascript" src="JS/CommonFields/common.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>
<div class="x-body">
    <table id="data" lay-filter="consume"></table>
</div>
<script>
    var table;
    layui.use(['laydate','table'], function(){
        var laydate = layui.laydate;
        table = layui.table;

        //执行一个laydate实例
        laydate.render({
            elem: '#start' //指定元素
        });

        //执行一个laydate实例
        laydate.render({
            elem: '#end' //指定元素
        });

        table.render({
            elem: '#data'
            ,height: 600
            ,url: '${pageContext.request.contextPath}/customer/credit/consume/list/data' //数据接口
            ,method: "post"
            ,page: true //开启分页
            ,cols: [[ //表头
                {type:'checkbox', fixed: 'left'}
                ,{field: 'consumeId', title: '支付ID', width:'15%', sort: true}
                ,{field: 'customerId', title: '客户ID', width:'15%',sort: true}
                ,{field: 'customerName', title: '客户姓名', width: '15%', templet:function (d) {
                        return d.customer.customerName;
                    }}
                ,{field: 'customerGender', title: '性别', width:'15%', templet:function (d) {
                        return d.customer.customerGender === 1 ? '男' : '女';
                    }}
                ,{field: 'typeId', title: '客户类型', width: '15%', templet:function (d) {
                        return d.customer.typeId===1?'VIP用户':'普通用户';
                    }}
                ,{field: 'consumePrice', title: '支付金额', width:'15%'}
                ,{field: 'isPay', title: '是否支付', width:'15%',templet:function (d) {
                        return d.isPay === 1 ? '已支付' : '未支付';
                    }}
                ,{field: 'consumeReputation', title: '本次支付信誉等级', width:'15%'}

            ]]
        });
    });
</script>
</body>

</html>
